using System;
using System.Drawing;
using System.Windows.Forms;

namespace caseDrawer
{
	public partial class SenariosForm : Form
	{
		public SenariosForm()
		{
			InitializeComponent();
			senarioGridView.DataSource = Database.Instance.loadSenarios();
		}

		void SenarioGridViewDoubleClick(object sender, EventArgs e)
		{
			DataGridViewRow row = senarioGridView.CurrentRow;

			Senario senario 	= new Senario();
			senario.Id			=  row.Cells[1].Value.ToString();
			senario.Name		=  row.Cells[2].Value.ToString();

			showSenarioForm(senario);

		}

		void BtGenerateClick(object sender, EventArgs e)
		{

		}

		void showSenarioForm(Senario senario){
			senarioForm senarioform = new senarioForm(senario);
			senarioform.renderTabPage();
			senarioform.Show();
		}
	}
}
